package dtos;

import java.util.ArrayList;
import java.util.List;

import jdtoextension.DateTimeFormatMerger;
import books.Category;

import com.juancavallotti.jdto.annotation.DTOCascade;
import com.juancavallotti.jdto.annotation.Source;

/**
 */
public class BookInfoDTO extends GenericDTO {

    private static final long serialVersionUID = 1L;

    private String title = "";

    private String isbn = "";

    private String description = "";

    @Source(value = "registrationDate", merger = DateTimeFormatMerger.class, mergerParam = "dd/MM/yyyy")
    private String registrationDate;

    @DTOCascade
    @Source(value = "publisher")
    private PublisherDTO publisher;

    @DTOCascade
    @Source(value = "authors")
    private List<AuthorDTO> authors;

    // @Source(value = "categories", merger = ListPropertyMergerString.class)
    private List<Category> categories;

    private boolean available;

    public BookInfoDTO() {
        super();
        this.setAuthors(new ArrayList<AuthorDTO>());
        this.setCategories(new ArrayList<Category>());
        this.available = true;
    }

    public String getTitle() {
        return this.title;
    }

    public void setTitle(final String title) {
        this.title = title;
    }

    public String getIsbn() {
        return this.isbn;
    }

    public void setIsbn(final String isbn) {
        this.isbn = isbn;
    }

    public String getDescription() {
        return this.description;
    }

    public void setDescription(final String description) {
        this.description = description;
    }

    public boolean isAvailable() {
        return this.available;
    }

    public void setAvailable(final boolean available) {
        this.available = available;
    }

    public void setRegistrationDate(final String registrationDate) {
        this.registrationDate = registrationDate;
    }

    public String getRegistrationDate() {
        return this.registrationDate;
    }

    public void setPublisher(final PublisherDTO aPublisher) {
        this.publisher = aPublisher;
    }

    public PublisherDTO getPublisher() {
        return this.publisher;
    }

    public void setAuthors(final List<AuthorDTO> anAuthors) {
        this.authors = anAuthors;
    }

    public List<AuthorDTO> getAuthors() {
        return this.authors;
    }

    public void setCategories(final List<Category> aCategories) {
        this.categories = aCategories;
    }

    public List<Category> getCategories() {
        return this.categories;
    }

}
